package org.wu.framework.authorization.platform.domain.model.sys.user.role;

import org.wu.framework.authorization.platform.infrastructure.entity.SysUserRoleDO;
import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomainRepository;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.spring.response.repository.LazyCrudRepository;

import java.util.List;

/**
 * describe 用户角色关联关系
 *
 * @author Jia wei Wu
 * @date 2023/05/17 11:19 晚上
 * @see DefaultDDDLazyDomainRepository
 **/

public interface SysUserRoleRepository extends LazyCrudRepository<SysUserRoleDO, SysUserRole, Integer> {


    /**
     * describe 新增用户角色关联关系
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<SysUserRole> story(SysUserRole sysUserRole);

    /**
     * describe 查询单个用户角色关联关系
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<SysUserRole> findOne(SysUserRole sysUserRole);

    /**
     * describe 查询多个用户角色关联关系
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<List<SysUserRole>> findList(SysUserRole sysUserRole);

    /**
     * describe 删除用户角色关联关系
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<SysUserRole> delete(SysUserRole sysUserRole);

    /**
     * description: 批量存储用户角色
     * @param userId 用户ID
     * @param sysUserRoleList  用户角色数据
     * @return
     * @author 吴佳伟
     * @date: 21.5.23 22:42
     */
    void batchStoryUserRole(Long userId, List<SysUserRole> sysUserRoleList);
}